<?php

namespace common\models\spread;

use Yii;

/**
 * This is the model class for table "{{%spread_type}}".
 *
 * @property int $id
 * @property string $name 名称
 * @property string $label
 * @property string $thumb 缩略图
 * @property string $description 描述
 * @property int $status 状态
 * @property int $created_at 获得时间
 * @property int $updated_at 更新时间
 * @property int $deleted_at
 */
class SpreadType extends \common\db\ActiveRecord {

    const STATUS_DEFAULT = 0;
    const STATUS_ACTIVE = 10;

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return '{{%spread_type}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['name', 'label'], 'required'],
            [['status', 'created_at', 'updated_at', 'deleted_at'], 'integer'],
            [['name', 'label'], 'string', 'max' => 50],
            [['thumb', 'description'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'name' => '名称',
            'label' => 'Name',
            'thumb' => '缩略图',
            'description' => '描述',
            'status' => '状态',
            'created_at' => '获得时间',
            'updated_at' => '更新时间',
            'deleted_at' => 'Deleted At',
        ];
    }

}
